var codeDom;
$(function () {
    codeDom = $('#code');
    $('#ff').on('click',('.textbox-button'),function () {  //textBox按钮点击事件
        // window.webkit.messageHandlers.openScanf.postMessage(null);
        window.top.openScan();
    });
});


$('#ff').on('click','#saveIn',function () {  //提交表单



});
/**
 * 扫码回调
 * @type {{setResult: JSObjectHandle.setResult}}
 * created by dale 2017/9/15
 */
var JSObjectHandle = {
    setResult : function (code) {
        setTimeout(function () {
            codeDom.textbox('setValue',code);
            if(code == ''){
                window.top.sendErrorMsg('设备码不能为空');
                return false;
            }
            $.ajax({
                url:baseUrl+'mobile/shortcut/saveUnbind',
                type:'post',
                data:$('#ff').serialize(),
                success:function (data) {
                    window.top.sendSuccessMsg(data);
                },
                error:function (data) {
                    window.top.sendErrorMsg(data['responseText']);
                }
            });
        },0);

    }
}



